[tests-only][full-ci] test: set custom auth level names #12548
Open
PrajwolAmatya wants to merge 1 commit into
Open
[tests-only][full-ci] test: set custom auth level names #12548PrajwolAmatya wants to merge 1 commit into
PrajwolAmatya wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
efe96d7 to
389e8b6
Compare
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
389e8b6 to
ee23137
Compare
nabim777
reviewed
Jul 14, 2026
Comment on lines
+369
to
+381
| if ($response->getStatusCode() === 200) { | ||
| return; | ||
| } | ||
| if (KeycloakHelper::isTestingWithKeycloak()) { | ||
| $this->waitForOcisProxyReady(); | ||
| return; | ||
| } | ||
| Assert::assertEquals( | ||
| 200, | ||
| $response->getStatusCode(), | ||
| "Failed to rollback ocis server. Check if oCIS is started with ociswrapper. Response: $resBody", | ||
| $errorMessage . " Response: " . $response->getBody()->getContents(), | ||
| ); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| if ($response->getStatusCode() === 200) { | |
| return; | |
| } | |
| if (KeycloakHelper::isTestingWithKeycloak()) { | |
| $this->waitForOcisProxyReady(); | |
| return; | |
| } | |
| Assert::assertEquals( | |
| 200, | |
| $response->getStatusCode(), | |
| "Failed to rollback ocis server. Check if oCIS is started with ociswrapper. Response: $resBody", | |
| $errorMessage . " Response: " . $response->getBody()->getContents(), | |
| ); | |
| } | |
| $statusCode = $response->getStatusCode(); | |
| if ($statusCode=== 200) { | |
| return; | |
| } | |
| if (KeycloakHelper::isTestingWithKeycloak()) { | |
| $this->waitForOcisProxyReady(); | |
| return; | |
| } | |
| Assert::assertEquals( | |
| 200, | |
| $statusCode, | |
| $errorMessage . " Response: " . $response->getBody()->getContents(), | |
| ); | |
| } |
| return; | ||
| } | ||
| } catch (\Exception $e) { | ||
| echo "oCIS not ready yet. Retrying in 1s..."; |
Member
There was a problem hiding this comment.
Suggested change
| echo "oCIS not ready yet. Retrying in 1s..."; | |
| echo "oCIS not ready yet. Retrying in 1s...\n"; |
Comment on lines
+396
to
+399
| $response = HttpRequestHelper::get($readyzUrl); | ||
| if ($response->getStatusCode() === 200) { | ||
| return; | ||
| } |
Member
There was a problem hiding this comment.
If the response has useful information, we can check it too. Otherwise, the existing status code check is enough.
| return; | ||
| } | ||
| } catch (\Exception $e) { | ||
| echo "oCIS not ready yet. Retrying in 1s..."; |
Member
There was a problem hiding this comment.
I think it would be good to include the exception message in the output.
| * @return void | ||
| * @throws Exception | ||
| */ | ||
| public function userShouldHaveAcrVaule(string $user, string $acr): void { |
Member
There was a problem hiding this comment.
Suggested change
| public function userShouldHaveAcrVaule(string $user, string $acr): void { | |
| public function userShouldHaveAcrValue(string $user, string $acr): void { |
| Assert::assertEquals( | ||
| $acr, | ||
| $actualAcr, | ||
| "Exected acr value to be $acr but got $actualAcr", |
Member
There was a problem hiding this comment.
Suggested change
| "Exected acr value to be $acr but got $actualAcr", | |
| "Expected acr value to be $acr but got $actualAcr", |
| * @throws Exception | ||
| */ | ||
| public function userShouldHaveAcrVaule(string $user, string $acr): void { | ||
| $access_token = $this->featureContext->getOcisUserToken($user)['token']['accessToken']; |
Member
There was a problem hiding this comment.
Suggested change
| $access_token = $this->featureContext->getOcisUserToken($user)['token']['accessToken']; | |
| $accessToken = $this->featureContext->getOcisUserToken($user)['token']['accessToken']; |
| [ | ||
| 'Authorization' => 'Bearer ' . self::getAdminAccessToken(), | ||
| ], | ||
| ); |
Member
There was a problem hiding this comment.
will be good to check the response status code here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added test to set the custom auth level names and check if that works correctly.
Related Issue
OCISDEV-1014
Screenshots (if appropriate):
Types of changes
Checklist: